<?php

use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});

/**
 * auv
 * auv@qq.com
 * 1qaz#EDC
 */
// 认证 的路由（注册、登录、退出等）
Auth::routes();

Route::get('/home', 'HomeController@index')->name('home');


/* Passport OAuth */
// 用户创建客户端
Route::get('/my-oauth2/index', 'MyAuthController@index');
// Route::get('/callback', 'MyAuthController@callback');

Route::get('/person-token', function ()
{
    $user = Auth::user();
    // var_dump($user);exit;
    $token = $user->createToken('Token Name')->accessToken;
    var_dump($token);
});
